﻿

using Bottle.CommunityForum.DAL;
using Bottle.CommunityForum.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Bottle.CommunityForum.Factory
{
    public partial class StaticDalFactory
    {
        public static string AssemblyDalName = System.Configuration.ConfigurationManager.AppSettings["AssemblyDalName"];

        public static IAttributesInfoDal GetCurrentAttributesInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".AttributesInfoDal") as IAttributesInfoDal;
        }

        public static ICommentsInfoDal GetCurrentCommentsInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".CommentsInfoDal") as ICommentsInfoDal;
        }

        public static IFavoritesInfoDal GetCurrentFavoritesInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".FavoritesInfoDal") as IFavoritesInfoDal;
        }

        public static IMessageInfoDal GetCurrentMessageInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".MessageInfoDal") as IMessageInfoDal;
        }

        public static INodesInfoDal GetCurrentNodesInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".NodesInfoDal") as INodesInfoDal;
        }

        public static IPageInfoDal GetCurrentPageInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".PageInfoDal") as IPageInfoDal;
        }

        public static IRoleInfoDal GetCurrentRoleInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".RoleInfoDal") as IRoleInfoDal;
        }

        public static ISettingsInfoDal GetCurrentSettingsInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".SettingsInfoDal") as ISettingsInfoDal;
        }

        public static ISettingsTypeInfoDal GetCurrentSettingsTypeInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".SettingsTypeInfoDal") as ISettingsTypeInfoDal;
        }

        public static ITagsInfoDal GetCurrentTagsInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".TagsInfoDal") as ITagsInfoDal;
        }

        public static ITopicsAttrInfoDal GetCurrentTopicsAttrInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".TopicsAttrInfoDal") as ITopicsAttrInfoDal;
        }

        public static ITopicsInfoDal GetCurrentTopicsInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".TopicsInfoDal") as ITopicsInfoDal;
        }

        public static IUserAttrInfoDal GetCurrentUserAttrInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".UserAttrInfoDal") as IUserAttrInfoDal;
        }

        public static IUserInfoDal GetCurrentUserInfoDal()
        {
            return Assembly.Load(AssemblyDalName).CreateInstance(AssemblyDalName + ".UserInfoDal") as IUserInfoDal;
        }
    }
}